﻿namespace Toybox.NicoSharp.Video.MyPage
{
	/// <summary>
	/// アイテムタイプ
	/// </summary>
	public enum ItemType
	{
		Douga = 0x00,
		User = 0x01,

		Seiga = 0x05,
		Book = 0x06,

		BloMagaArticle = 0x0D,
	}

	public class Item
	{

		#region [Static]

		private const string FORMAT = "item_type={0}&item_id={1}&description={2}";
		private const string FORMAT_WITHOUT_DESC = "item_type={0}&item_id={1}";
		private const string FORMAT_FOR_LIST = "id_list[{0}][]={1}";

		#endregion [Static]


		#region Constructor

		public Item()
		{
		}

		public Item(ItemType type, string id)
		{
			this.Type = type;
			this.Id = id;
		}

		#endregion Constructor

		#region Public Members

		public ItemType Type { get; set; }
		public string Id { get; set; }
		public string Description { get; set; }

		#endregion Public Members


		#region Public Methods

		public string ToStringForList()
		{
			return string.Format(FORMAT_FOR_LIST, (int)this.Type, this.Id);
		}

		public string ToStringWithDesc()
		{
			return string.Format(FORMAT, (int)this.Type, this.Id, this.Description);
		}

		public string ToStringWithoutDesc()
		{
			return string.Format(FORMAT_WITHOUT_DESC, (int)this.Type, this.Id);
		}

		#endregion Public Methods

		#region Override Methods

		public override string ToString()
		{
			return this.ToStringWithDesc();
		}

		#endregion Override Methods

	}
}
